package com.app.teaware.bean;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.app.teaware.basis.Constants;
import com.google.gson.Gson;

import my.http.MyBaseBean;

public abstract class BaseListBeanXF extends BasisBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static final int INIT_PAGE = 0;
	public static final int PAGE_SIZE = Constants.PAGE_SIZE;
	public static final String PAGE_SIZE_NAME = "pageSize";
	public static final String PAGE_NAME = "pageNo";


	/**
	 * @return the nextPage
	 */
	public int getNextPage() {
		return getCurrent()+1;
	}


	public void refresh(){
		setCurrent(INIT_PAGE);
		setTotal(0);
	}

	public boolean hasNextPage() {
		return getCurrent() < getPage();
	}


	public void setListBeanData(BaseListBeanXF listbean){
		if(listbean == null)return;
		setPage(listbean.getPage());
		setSize(listbean.getSize());
		setCurrent(listbean.getCurrent());
		setTotal(listbean.getTotal());
	}




	private int pages;
	private int size;
	private int current;
	private int total;

	public int getPage() {
		return pages;
	}

	public void setPage(int page) {
		this.pages = page;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getCurrent() {
		return current;
	}

	public void setCurrent(int current) {
		this.current = current;
	}



}
